package com.ucode.application.form.crm;

import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Length;
import com.ucode.springboot.starter.web.validator.annotation.CheckMember;
import com.ucode.springboot.starter.web.validator.group.AddGroup;
import com.ucode.springboot.starter.web.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@SuppressWarnings("serial")
@ApiModel(value="联系人")
public class ContactsForm implements Serializable{

    /**
     * 客户Id
     */
    @ApiModelProperty(value = "客户Id",required=true)
    @NotNull(message="客户不能为空",groups = {AddGroup.class})
    private Long customerId;
    
    @ApiModelProperty(value = "联系人名称",required=true)
    @NotBlank(message = "联系人名称不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Length(max=100,message = "客户名称最大50个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String name;
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号",required=true)
    @NotBlank(message = "手机号不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Pattern(regexp = "^(1[3-9])\\d{9}$",message = "手机号码格式错误", groups = {AddGroup.class,UpdateGroup.class})
    private String mobile;
    /**
     * 电话
     */
    @ApiModelProperty(value = "电话",required=false)
    @Pattern(regexp = "^$|(([0-9-()（）]{7,18}))$",message = "电话号码格式错误", groups = {AddGroup.class,UpdateGroup.class})
    private String telephone;
    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱",required=false)
    @Length(max=50,message = "邮箱最大长度50字符", groups = {AddGroup.class,UpdateGroup.class})
    @Pattern(regexp = "^$|((\\w[-\\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\\.)+[A-Za-z]{2,14}))$",message = "邮箱格式错误", groups = {AddGroup.class,UpdateGroup.class})
    private String email;
    /**
     * 微信
     */
    @ApiModelProperty(value = "微信",required=false)
    @Length(max=50,message = "微信最大长度50字符", groups = {AddGroup.class,UpdateGroup.class})
    private String wechat;
    /**
     * QQ号
     */
    @ApiModelProperty(value = "微信",required=false)
    @Length(max=150,message = "邮箱最大长度50字符", groups = {AddGroup.class,UpdateGroup.class})
    private String qq;
    /**
     * 是否为关键决策人0是1否
     */
    @ApiModelProperty(value = "是否为关键决策人:0是1否",required=false,example="1")
    @CheckMember(value={"0","1"},message="是否为关键决策人非法", groups = {AddGroup.class,UpdateGroup.class})
    private Integer dm;
    /**
     * 职务
     */
    @ApiModelProperty(value = "职务",required=false)
    @Length(max=250,message = "职务最大长度250字符", groups = {AddGroup.class,UpdateGroup.class})
    private String job;
    /**
     * 生日
     */
    @ApiModelProperty(value = "生日",required=false)
    private Date birthday;
    /**
     * 性别：0 未知 1 男 2 女 
     */
    @ApiModelProperty(value = "性别:0未知1男2女",required=true,example="0",dataType="Integer")
    @NotNull(message = "联系人性别性别不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @CheckMember(value={"0","1","2"},message="联系人性别性别非法", groups = {AddGroup.class,UpdateGroup.class})
    private Integer sex;
    /**
     * 地址
     */
    @ApiModelProperty(value = "详细地址",required=false)
    @Length(max=255,message = "详细地址最大长度255字符", groups = {AddGroup.class,UpdateGroup.class})
    private String address;
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注",required=false)
    @Length(max=500,message = "备注最大长度500字符", groups = {AddGroup.class,UpdateGroup.class})
    private String remark;
    
    public Long getCustomerId() {
        return customerId;
    }
    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getTelephone() {
        return telephone;
    }
    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getWechat() {
        return wechat;
    }
    public void setWechat(String wechat) {
        this.wechat = wechat;
    }
    public String getQq() {
        return qq;
    }
    public void setQq(String qq) {
        this.qq = qq;
    }
    public Integer getDm() {
        return dm;
    }
    public void setDm(Integer dm) {
        this.dm = dm;
    }
    public String getJob() {
        return job;
    }
    public void setJob(String job) {
        this.job = job;
    }
    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    public Integer getSex() {
        return sex;
    }
    public void setSex(Integer sex) {
        this.sex = sex;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }

}
